<template>
    <div class="love_container">
        <!-- 猜你喜欢 -->
        <div class="Mabeylike">
            <div class="like">猜你喜欢</div>
            <div class="refresh" id="refresh">
                <i :class="[ rotate?  'el-icon-refresh go' : ' el-icon-refresh gos' ]" @click="start"> </i>
            </div>
        </div>
        <!--猜你喜欢的内容  -->
        <div class="goods_content" v-if="num===0">
            <ul class="love_contents" v-for="item in mablike1" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===1">
            <ul class="love_contents" v-for="item in mablike2" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===2">
            <ul class="love_contents" v-for="item in mablike3" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===3">
            <ul class="love_contents" v-for="item in mablike4" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===4">
            <ul class="love_contents" v-for="item in mablike5" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===5">
            <ul class="love_contents" v-for="item in mablike6" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===6">
            <ul class="love_contents" v-for="item in mablike7" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===7">
            <ul class="love_contents" v-for="item in mablike8" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===8">
            <ul class="love_contents" v-for="item in mablike9" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
        <div class="goods_content" v-if="num===9">
            <ul class="love_contents" v-for="item in mablike10" :key="item.id">
                <li class="goods">
                   {{ item.contents }}
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
export default {
    name: 'Mabeylike',

    data() {
        return {
            num:[],
            rotate: false,
            mablike1:[
                {
                    id:1,
                    contents:"手机",
                },
                {
                    id:2,
                    contents:"手机",
                },
                {
                    id:3,
                    contents:"手机",
                },
                {
                    id:4,
                    contents:"手机",
                },
                {
                    id:5,
                    contents:"手机",
                },
                {
                    id:6,
                    contents:"手机",
                },
                {
                    id:7,
                    contents:"手机",
                },
                {
                    id:8,
                    contents:"手机",
                },
                {
                    id:9,
                    contents:"手机",
                },
                {
                    id:10,
                    contents:"手机",
                },  {
                    id:11,
                    contents:"手机",
                },
                {
                    id:12,
                    contents:"手机",
                },
                {
                    id:13,
                    contents:"手机",
                },
                {
                    id:14,
                    contents:"手机",
                },
                {
                    id:15,
                    contents:"手机",
                },
                {
                    id:16,
                    contents:"手机",
                },
            ],
            mablike2:[
                {
                    id:1,
                    contents:"苹果",
                },
                {
                    id:2,
                    contents:"苹果",
                },
                {
                    id:3,
                    contents:"苹果",
                },
                {
                    id:4,
                    contents:"苹果",
                },
                {
                    id:5,
                    contents:"苹果",
                },
                {
                    id:6,
                    contents:"苹果",
                },
                {
                    id:7,
                    contents:"苹果",
                },
                {
                    id:8,
                    contents:"苹果",
                },
                {
                    id:9,
                    contents:"苹果",
                },
                {
                    id:10,
                    contents:"苹果",
                },  {
                    id:11,
                    contents:"苹果",
                },
                {
                    id:12,
                    contents:"苹果",
                },
                {
                    id:13,
                    contents:"苹果",
                },
                {
                    id:14,
                    contents:"苹果",
                },
                {
                    id:15,
                    contents:"苹果",
                },
                {
                    id:16,
                    contents:"苹果",
                },
            ],
            mablike3:[
                {
                    id:1,
                    contents:"iphone",
                },
                {
                    id:2,
                    contents:"iphone",
                },
                {
                    id:3,
                    contents:"iphone",
                },
                {
                    id:4,
                    contents:"iphone",
                },
                {
                    id:5,
                    contents:"iphone",
                },
                {
                    id:6,
                    contents:"iphone",
                },
                {
                    id:7,
                    contents:"iphone",
                },
                {
                    id:8,
                    contents:"iphone",
                },
                {
                    id:9,
                    contents:"iphone",
                },
                {
                    id:10,
                    contents:"iphone",
                },  {
                    id:11,
                    contents:"iphone",
                },
                {
                    id:12,
                    contents:"iphone",
                },
                {
                    id:13,
                    contents:"iphone",
                },
                {
                    id:14,
                    contents:"iphone",
                },
                {
                    id:15,
                    contents:"iphone",
                },
                {
                    id:16,
                    contents:"iphone",
                },
            ],
            mablike4:[
                {
                    id:1,
                    contents:"1",
                },
                {
                    id:2,
                    contents:"1",
                },
                {
                    id:3,
                    contents:"1",
                },
                {
                    id:4,
                    contents:"1",
                },
                {
                    id:5,
                    contents:"1",
                },
                {
                    id:6,
                    contents:"1",
                },
                {
                    id:7,
                    contents:"1",
                },
                {
                    id:8,
                    contents:"1",
                },
                {
                    id:9,
                    contents:"1",
                },
                {
                    id:10,
                    contents:"1",
                },  {
                    id:11,
                    contents:"1",
                },
                {
                    id:12,
                    contents:"1",
                },
                {
                    id:13,
                    contents:"1",
                },
                {
                    id:14,
                    contents:"1",
                },
                {
                    id:15,
                    contents:"1",
                },
                {
                    id:16,
                    contents:"1",
                },
            ],
            mablike5:[
                {
                    id:1,
                    contents:"2",
                },
                {
                    id:2,
                    contents:"2",
                },
                {
                    id:3,
                    contents:"2",
                },
                {
                    id:4,
                    contents:"2",
                },
                {
                    id:5,
                    contents:"2",
                },
                {
                    id:6,
                    contents:"2",
                },
                {
                    id:7,
                    contents:"2",
                },
                {
                    id:8,
                    contents:"2",
                },
                {
                    id:9,
                    contents:"2",
                },
                {
                    id:10,
                    contents:"2",
                },  {
                    id:11,
                    contents:"2",
                },
                {
                    id:12,
                    contents:"2",
                },
                {
                    id:13,
                    contents:"2",
                },
                {
                    id:14,
                    contents:"2",
                },
                {
                    id:15,
                    contents:"2",
                },
                {
                    id:16,
                    contents:"2",
                },
            ],
            mablike6:[
                {
                    id:1,
                    contents:"5",
                },
                {
                    id:2,
                    contents:"5",
                },
                {
                    id:3,
                    contents:"5",
                },
                {
                    id:4,
                    contents:"5",
                },
                {
                    id:5,
                    contents:"5",
                },
                {
                    id:6,
                    contents:"5",
                },
                {
                    id:7,
                    contents:"5",
                },
                {
                    id:8,
                    contents:"5",
                },
                {
                    id:9,
                    contents:"5",
                },
                {
                    id:10,
                    contents:"5",
                },  {
                    id:11,
                    contents:"5",
                },
                {
                    id:12,
                    contents:"5",
                },
                {
                    id:13,
                    contents:"5",
                },
                {
                    id:14,
                    contents:"5",
                },
                {
                    id:15,
                    contents:"5",
                },
                {
                    id:16,
                    contents:"5",
                },
            ],
            mablike7:[
                {
                    id:1,
                    contents:"6",
                },
                {
                    id:2,
                    contents:"6",
                },
                {
                    id:3,
                    contents:"6",
                },
                {
                    id:4,
                    contents:"6",
                },
                {
                    id:5,
                    contents:"6",
                },
                {
                    id:6,
                    contents:"6",
                },
                {
                    id:7,
                    contents:"6",
                },
                {
                    id:8,
                    contents:"6",
                },
                {
                    id:9,
                    contents:"6",
                },
                {
                    id:10,
                    contents:"6",
                },  {
                    id:11,
                    contents:"6",
                },
                {
                    id:12,
                    contents:"6",
                },
                {
                    id:13,
                    contents:"6",
                },
                {
                    id:14,
                    contents:"6",
                },
                {
                    id:15,
                    contents:"6",
                },
                {
                    id:16,
                    contents:"6",
                },
            ],
            mablike8:[
                {
                    id:1,
                    contents:"8",
                },
                {
                    id:2,
                    contents:"8",
                },
                {
                    id:3,
                    contents:"8",
                },
                {
                    id:4,
                    contents:"8",
                },
                {
                    id:5,
                    contents:"8",
                },
                {
                    id:6,
                    contents:"8",
                },
                {
                    id:7,
                    contents:"8",
                },
                {
                    id:8,
                    contents:"8",
                },
                {
                    id:9,
                    contents:"8",
                },
                {
                    id:10,
                    contents:"8",
                },  {
                    id:11,
                    contents:"8",
                },
                {
                    id:12,
                    contents:"8",
                },
                {
                    id:13,
                    contents:"8",
                },
                {
                    id:14,
                    contents:"8",
                },
                {
                    id:15,
                    contents:"8",
                },
                {
                    id:16,
                    contents:"8",
                },
            ],
            mablike9:[
                {
                    id:1,
                    contents:"9",
                },
                {
                    id:2,
                    contents:"9",
                },
                {
                    id:3,
                    contents:"9",
                },
                {
                    id:4,
                    contents:"9",
                },
                {
                    id:5,
                    contents:"9",
                },
                {
                    id:6,
                    contents:"9",
                },
                {
                    id:7,
                    contents:"9",
                },
                {
                    id:8,
                    contents:"9",
                },
                {
                    id:9,
                    contents:"9",
                },
                {
                    id:10,
                    contents:"9",
                },  {
                    id:11,
                    contents:"9",
                },
                {
                    id:12,
                    contents:"9",
                },
                {
                    id:13,
                    contents:"9",
                },
                {
                    id:14,
                    contents:"9",
                },
                {
                    id:15,
                    contents:"9",
                },
                {
                    id:16,
                    contents:"9",
                },
            ],
            mablike10:[
                {
                    id:1,
                    contents:"0",
                },
                {
                    id:2,
                    contents:"0",
                },
                {
                    id:3,
                    contents:"0",
                },
                {
                    id:4,
                    contents:"0",
                },
                {
                    id:5,
                    contents:"0",
                },
                {
                    id:6,
                    contents:"0",
                },
                {
                    id:7,
                    contents:"0",
                },
                {
                    id:8,
                    contents:"0",
                },
                {
                    id:9,
                    contents:"0",
                },
                {
                    id:10,
                    contents:"0",
                },  {
                    id:11,
                    contents:"0",
                },
                {
                    id:12,
                    contents:"0",
                },
                {
                    id:13,
                    contents:"0",
                },
                {
                    id:14,
                    contents:"0",
                },
                {
                    id:15,
                    contents:"0",
                },
                {
                    id:16,
                    contents:"0",
                },
            ],
        };
    },

    mounted() {
        
    },

    methods: {
        start() {
                 this.rotate = !this.rotate;
                 console.log(this.rotate);
                //  console.log(parseInt(10*Math.random()));
                 this.num=parseInt(10*Math.random())
                 console.log(this.num);
             }
    },
};
</script>

<style scoped>
.refresh{
    cursor: pointer;
    width: 40px;
    height: 40px;
}
.go {
    transform: rotate(-360deg);
    transition: all 1s;
}
.gos{
    transition: all 1s;
    transform: rotate(360deg);
}
.Mabeylike{
    margin-top: 30px;
    width: 400px;
    height: 40px;
    display: flex;
    background: #f4f4f4;;
}
.like{
    width: 90%;
    line-height: 40px;
    font-weight: bold;
}
.refresh>i{
    margin-top: 12px;
    margin-left: 10px;
}
.love_contents{
    width: 30%;
    display: inline-block;
    margin-left: 10px;
    margin-top: 10px;
    cursor: pointer;
}

.goods{
    text-align: center;
    line-height: 30px;
    list-style: none;
    background: #e0e0e0;
    border-radius: 15px;
}
.goods:hover{
    background: #f4f4f4;
}
.goods_content{
    width: 400px;
    height: 265px;
    overflow: hidden;
    margin-top: 20px;
}
</style>